GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get

COMMIT_ID=$(shell git rev-parse HEAD)
GO_VERSION=$(shell go version)
BUILD_TIME=$(shell date +%F-%T)


LDFLAGS=-ldflags "-X 'main.CommitId=${COMMIT_ID}' -X 'main.BuildTime=${BUILD_TIME}' -X 'main.GoVersion=${GO_VERSION}'"

build-server:
	$(GOBUILD) ${LDFLAGS} -o ./bin/server -v ./server/server.go
	$(GOBUILD) ${LDFLAGS} -o ./bin/websocket -v ./websocket/websocket.go
	$(GOBUILD) ${LDFLAGS} -o ./bin/game-server -v ./game_server/game_server.go

